PlatformApi

interface PlatformApi

API for abstraction of simple ModLoader requests

See the Wiki for more details and examples.

Author

fzzyhmstrs

Since

0.5.0

Functions

Link copied to clipboard
abstract fun <T : Any> buildRegistryTranslations(obj: T, prefix: String, lang: String, logWarnings: Boolean, builder: BiConsumer<String, String>)

Applies a set of translations for the provided registry instance to the provided builder. Uses Translatable.Name, Translatable.Desc, and Translatable.Prefix annotations to power the generation. TomlComment and Comment can be used to provide en_us description lang.

Link copied to clipboard
abstract fun configDir(): File

The config directory

Link copied to clipboard
abstract fun <T> createRegistrar(namespace: String, registry: Registry<T>): Registrar<T>

Creates a Registrar wrapper for registering objects in a platform-agnostic way.

Link copied to clipboard
abstract fun <T> createRegistryBuilder(namespace: String): RegistryBuilder

Creates a RegistryBuilder for creating registries in a platform-agnostic way, along with providing other registry utilities.

Link copied to clipboard
abstract fun devLogger(name: String): Logger

Returns a logger that checks if the current environment isDev before doing any logging

Link copied to clipboard
abstract fun gameDir(): File

The root game directory

Link copied to clipboard
abstract fun isClient(): Boolean

Whether the game includes a logical client or not. This will be true both for singleplayer games and the client side of a multiplayer game.

Link copied to clipboard
abstract fun isDev(): Boolean

Whether the current JVM environment is a development environment

Link copied to clipboard
abstract fun isModLoaded(mod: String): Boolean

Returns whether another mod is loaded based on their registered mod_id.

Link copied to clipboard
abstract fun testVersion(id: String, version: String): Optional<Int>

Tests the version of the provided mod (or minecraft)